<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<title>Proxy</title>
	</head>
	<body>
		<script>
			const user = {
				name: "张三",
				age: 18
			}
			const n = new Proxy(user, {
				get(target, key) {
					console.log("get", target, key)
					return target[key]
				},
				set(target, key, val) {
					console.log("set", target, key, val)
					target[key] = val
				},
				deleteProperty(target, key) {
					console.log("deleteProperty", target, key)
					// return delete target[key]
					console.log("Reflect", Reflect)
					return Reflect.deleteProperty(target, key)
				}
			})
		</script>
	</body>
</html>